import requests
import execjs

headers = {
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"
}
cookies = {
    "sessionid": "i0rysbnzy9ms81upt0abofl60rhrmfkz"
}
url = "https://match.yuanrenxue.cn/api/match/6"
with open(r'E:\Python\vscode\Crawlers\yuanrenxue\no6\task6_a.js', 'r', encoding='utf-8') as f:
    js = execjs.compile(f.read())
three_j = 0
for i in range(1,6):
    params_value = js.call('params_key',i)
    params = {
        "page": params_value['page'],
        "m": params_value['m'],
        "q": params_value['q']
    }
    response = requests.get(url, headers=headers, cookies=cookies, params=params)
    for i in response.json()['data']:
        three_j += i['value']
print(three_j * 24)
    